from nonebot.adapters.cqhttp.event import FriendRequestEvent
from nonebot.typing import T_State
from nonebot.adapters.cqhttp import Bot,Event
from nonebot.plugin import on_request
from pydantic.tools import T

async def _add_request(bot:Bot, event:Event,state:T_State)->bool:
    return isinstance(event,FriendRequestEvent)

add_request=on_request(_add_request, priority=10,block=True)
@add_request.handle()
async def add_request_handle(bot:Bot, event:Event,state:T_State):
    await event.approve(bot)